<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>v-if 与 v-else</title>
  <style>
    .success {
      color: green;
    }

    .error {
      color: red;
    }
  </style>
</head>

<body>

  <div id="app">
    <h3 class="success" v-if="isShow">
      <div>条件正确 {{ message }}</div>
    </h3>
    <h3 class="error" v-else>
      <div>条件错误 {{ message }}</div>
    </h3>
  </div>

  <script src="../../js/vue.js"></script>
  <script>
    const app = new Vue({
      el: '#app',
      data: {
        message: 'hello',
        isShow: true
      }
    })
  </script>
</body>

</html>